package com.portalEsporteClubeBahia.app.vo;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

public class MatchVO implements Serializable {

	private static final long serialVersionUID = -1155182391317439081L;
	
	private Integer id;
	private TeamVO homeTeam;
	private TeamVO awayTeam;
	private StadiumVO stadium;
	private ChampionshipVO championship;
	private Date date;
	private Date dateUTC;
	private Short homeGoals;
	private Short awayGoals;
	private Boolean finished;
	private Boolean active;
	private String dateString;
	private String dateUTCString;
	
	public MatchVO(){
		this.homeTeam = new TeamVO();
		this.awayTeam = new TeamVO();
		this.stadium = new StadiumVO();
		this.championship = new ChampionshipVO();
		active = true;
	}
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public TeamVO getHomeTeam() {
		return homeTeam;
	}
	public void setHomeTeam(TeamVO homeTeam) {
		this.homeTeam = homeTeam;
	}
	public TeamVO getAwayTeam() {
		return awayTeam;
	}
	public void setAwayTeam(TeamVO awayTeam) {
		this.awayTeam = awayTeam;
	}
	public StadiumVO getStadium() {
		return stadium;
	}
	public void setStadium(StadiumVO stadium) {
		this.stadium = stadium;
	}
	public ChampionshipVO getChampionship() {
		return championship;
	}
	public void setChampionship(ChampionshipVO championship) {
		this.championship = championship;
	}
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public Date getDateUTC() {
		return dateUTC;
	}
	public void setDateUTC(Date dateUTC) {
		this.dateUTC = dateUTC;
	}
	public Short getHomeGoals() {
		return homeGoals;
	}
	public void setHomeGoals(Short homeGoals) {
		this.homeGoals = homeGoals;
	}
	public Short getAwayGoals() {
		return awayGoals;
	}
	public void setAwayGoals(Short awayGoals) {
		this.awayGoals = awayGoals;
	}
	public Boolean getFinished() {
		return finished;
	}
	public void setFinished(Boolean finished) {
		this.finished = finished;
	}
	public Boolean getActive() {
		return active;
	}
	public void setActive(Boolean active) {
		this.active = active;
	}
	public String getDateFormat(){
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm");
		try{
			return sdf.format(date);
		}catch(Exception e){
			return "";
		}
	}
	public String getDateUTCFormat(){
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm");
		try{
			return sdf.format(dateUTC);
		}catch(Exception e){
			return "";
		}
	}

	public String getDateString() {
		return dateString;
	}

	public void setDateString(String dateString) {
		this.dateString = dateString;
	}

	public String getDateUTCString() {
		return dateUTCString;
	}

	public void setDateUTCString(String dateUTCString) {
		this.dateUTCString = dateUTCString;
	}
	
	public String getDateStringFormat(){
		try{
			String date = "";
			String[] array = this.dateString.split("/");
			date = array[2]+"-"+array[1]+"-"+array[0];
			
			return date;
		}catch(Exception e){
			return null;
		}
	}
	
	public String getDateUTCStringFormat(){
		try{
			String date = "";
			String[] array = this.dateUTCString.split("/");
			date = array[2]+"-"+array[1]+"-"+array[0];
			
			return date;
		}catch(Exception e){
			return null;
		}
	}

}
